package com.chinaunicom.behavior.command;

import java.util.ArrayList;
import java.util.List;

/**
 * @author liry
 * @version 1.0
 * @date Created on 2022/8/15 15:13
 * Description:
 */
public class Application {

    private Editor editor;
    private List<Command> commandList = new ArrayList<>();

    public Application(Editor editor) {
        this.editor = editor;
    }

    public void createUI() {
        CopyCommand copyCommand = new CopyCommand(editor);
        PastCommand pastCommand = new PastCommand(editor);

        commandList.add(copyCommand);
        commandList.add(pastCommand);
    }
    
    
    public void executeCommand(){
        commandList.forEach(v->{
            v.execute();
        });
    }

}
